package gaoyijiankao;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

public class StaticNumber {
//    static int[] maxClass= new int[]{1, 2, 3,4,6,7,9,10,12,13,14,16,18};
//    static int[] minClass=new int[]{5,8,11,15,17,19,20,21};

    static int[] class54=new int[]{21,16,13,8,7,6,3,2,1};//9
    static int[] class48=new int[]{18,17,15,14,12,11,10,9,5,4};//10
    static int[] class42=new int[]{22,20,19};

    private static Queue<Integer> queue54;
    private static Queue<Integer> queue48;
    private static Queue<Integer> queue42;

    public static int getA54Class(){
        return queue54.poll();
    }

    public static int getA48Class(){
        return queue48.poll();
    }

    public static int getA42Class(){
        return queue42.poll();
    }

    public StaticNumber(){
        init();
    }

    public static void init(){
        queue54=new LinkedList<>();
        queue54.addAll(new ArrayList<Integer>(Arrays.asList(1,2,3,6,7,8,13,16,21)));
        queue48=new LinkedList<>();
        queue48.addAll(new ArrayList<Integer>(Arrays.asList(4,5,9,10,11,12,14,15,17,18)));
        queue42=new LinkedList<>();
        queue42.addAll(new ArrayList<Integer>(Arrays.asList(19,20,22)));
    }

    public static int getClassSize(int classNumber){
        int[] datas=new int[]{48,48,54,48,48,48,48,48,48,48,48,48,54,48,48,48,48,48,48,48,54,42,42,42};
        return datas[classNumber-1];
//        if(new ArrayList<Integer>(Arrays.asList(1,2,3,6,8,9,13,16,21)).contains(classNumber)){
//            return 54;
//        }else if(new ArrayList<Integer>(Arrays.asList(4,5,7,9,10,11,12,14,15,17,18)).contains(classNumber)){
//            return 48;
//        }else if(new ArrayList<Integer>(Arrays.asList(19,20,22,23)).contains(classNumber)){
//            return 42;
//        }
//        return 0;
    }
}
